{include file="public/header" /}
<body>
<div class="layui-tab-brief main-tab-container">
    <ul class="layui-tab-title main-tab-title">
        <a href="{:url('article/index_cate')}"><li>栏目列表</li></a>
        <a href="{:url('article/add_cate')}"><li class="layui-this">修改栏目</li></a>
        <div class="main-tab-item">栏目管理</div>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form" onsubmit="return false">
                <div class="layui-tab layui-tab-card">
                    <ul class="layui-tab-title">
                        <li class="layui-this">基本选项</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <input type="hidden" name="cate_id" value="{$cate.cate_id}">
                            <div class="layui-form-item">
                                <label class="layui-form-label">栏目名称</label>
                                <div class="layui-input-inline input-custom-width">
                                    <input type="text" name="name" value="{$cate.name}" lay-verify="required" autocomplete="off" placeholder="请输入修改名称" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">修改描述</label>
                                <div class="layui-input-inline input-custom-width">
                                    <textarea name="description" lay-verify="" autocomplete="off" placeholder="请输入修改描述" class="layui-textarea">{$cate.description}</textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline input-custom-width">
                                    <input type="text" name="sort" value="{$cate.sort}" lay-verify="number" autocomplete="off" placeholder="数字越小越靠前" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">是否导航显示</label>
                                <div class="layui-input-inline input-custom-width">
                                    {if condition="$cate.status eq '1'"}
                                    <input type="radio" name="status" value="1" title="是" checked=""><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><span>是</span></div>
                                    <input type="radio" name="status" value="0" title="否"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><span>否</span></div></div>
                                <div class="layui-form-mid layui-word-aux">
                                    {else /}
                                    <input type="radio" name="status" value="1" title="是" ><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><span>是</span></div>
                                    <input type="radio" name="status" value="0" title="否" checked=""><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><span>否</span></div></div>
                                <div class="layui-form-mid layui-word-aux">
                                    {/if}
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="cate_edit" type="button" id="sbtn">立即修改</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#sbtn").click(function(){
        $.ajax({
            url: "{:url('article/edit_cate')}",
            data: $("form").serialize(),
            type: "POST",
            datatype:"json",
            success: function( result ) {
                layer.open({
                    title: '信息'
                    ,content: '更新成功！'
                });
            }
        });
    });
</script>
<script type="text/javascript">
    layui.use(['element', 'form'], function(){
        var element = layui.element()
            ,form = layui.form()
            ,jq = layui.jquery;
    })
</script>
</body>
</html>

